<admintpl file="header"/>
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">
  <ul class="nav nav-tabs">
     <li><a href="{:U('Statistics/index')}">用户列表</a></li>
     <li><a href="{:U('Statistics/source')}">来源统计</a></li>
     <li><a href="{:U('Statistics/month')}">月注册数</a></li>
     <li class="active"><a href="{:U('Statistics/day')}">日注册数</a></li>
  </ul>
  		<form class="well form-search J_ajaxForm" method="post" action="{:U('Statistics/day')}">
			<div class="search_type cc mb10">
				<div class="mb10">
					<span class="mr20">注册时间： 
						<input type="text" name="start_time" value="{$formpost.start_time}" required="required" class="J_date" style="width: 80px;">~
						<input type="text" name="end_time" value="{$formpost.end_time}" class="J_date" style="width: 80px;"> &nbsp; &nbsp;
						<input type="submit" class="btn btn-primary" name="search" value="搜索" />
					</span>
				</div>
			</div>
		</form>
    <!-- 为ECharts准备一个具备大小（宽高）的Dom -->
    <div id="main" style="height:450px;width: 800px;"></div>
    <!-- ECharts单文件引入 -->
    <script src="__ROOT__/statics/js/echarts.js"></script>
    <script type="text/javascript">
        // 路径配置
        require.config({
            paths: {
                echarts: 'http://echarts.baidu.com/build/dist'
            }
        });
        
        // 使用
        require(
            [
                'echarts',
                'echarts/chart/line'
            ],
            function (ec) {
                // 基于准备好的dom，初始化echarts图表
                var myChart = ec.init(document.getElementById('main')); 
option = {
   title: {
		   <if condition="$formpost['start_time']">
      	 text: "{$formpost.start_time}至今用户注册量走势图",
       </if>
		   <if condition="$formpost['start_time'] && $formpost['end_time']">
      	 text: "{$formpost.start_time}至{$formpost.end_time}用户注册量走势图",
       </if>
		   <if condition="!$formpost['start_time'] && !$formpost['end_time']">
       	text: "最近30天用户注册量走势图",
       </if>
       x: "center"
   },
    tooltip : {
        trigger: 'axis'
    },
    toolbox: {
        show : true,
        feature : {
            restore : {show: true},
            saveAsImage : {show: true}
        }
    },
    calculable : true,
    xAxis : [
        {
            type : 'category',
            boundaryGap : false,
            data : [
	          <php>
							for($i = count($num)-1;$i >= 0;$i--){
									echo '"'.$num[$i][mon].'",';
							}
						</php>
            ]
        }
    ],
    yAxis : [
        {
            type : 'value'
        }
    ],
    series : [
        {
	          name: "注册量",
	          type: "line",
            data:[
						<php>
								for($i = count($num)-1;$i >= 0;$i--){
										echo $num[$i][num].',';
								}
						</php>
            ]
        }
    ]
};

                // 为echarts对象加载数据 
                myChart.setOption(option); 
            }
        );
    </script>
</div>
<script type="text/javascript" src="__ROOT__/statics/js/common.js"></script>
</body>
</html>